import random

# list 的嵌套，类似二维数组
teachers = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M']
rooms = [[], [], []]
for teacher in teachers:
    room = random.choice(rooms)
    room.append(teacher)
print(rooms)
for room in rooms:
    print('room%d has %d teachers' % (rooms.index(room), len(room)))
# for in 循环可以带下标 0 <= i <= len - 1
for i, room in enumerate(rooms):
    print('%d teachers in room%d' % (len(room), i))
    for teacher in room:
        print(teacher, end=' ')
    print()
